using System;
using GameStateManagement.Input;
using GameStateManagement.Model;
using Microsoft.Xna.Framework.Input.Touch;

namespace GameStateManagement.View.Gui
{
    class GuiTouchControler : TouchInputHandler
    {
        private GameModel _game;
        private readonly GuiManager _guiManager;

        public GuiTouchControler(InputFsm machine, GameModel game, GuiManager guiManager)
            : base(machine)
        {
            _game = game;
            _guiManager = guiManager;
        }

        #region Overrides of ControlerBase

        public override bool HandleInput(InputState state)
        {
            bool inputHandled = false;
            foreach (var gesture in state.Gestures)
            {
                switch (gesture.GestureType)
                {
                    case GestureType.Tap:
                        inputHandled = _guiManager.HandleClick(gesture.Position);
                        break;
                }
            }

            return inputHandled;
        }

        #endregion

        #region Overrides of TouchControler

        protected override bool HandleTap(GestureSample gesture)
        {
            throw new NotImplementedException();
        }

        protected override bool HandleFreeDrag(GestureSample gesture)
        {
            throw new NotImplementedException();
        }

        protected override bool HandleDragComplete(GestureSample gesture)
        {
            throw new NotImplementedException();
        }

        protected override bool HandlePinch(GestureSample gesture)
        {
            throw new NotImplementedException();
        }

        private void RestartGame()
        {
            
        }

        #endregion
    }
}
